All Questions
4 questions
1vote
4answers
4kviews
immutable string in array, reference type vs value type
Trying to understand strings better in C# Are these assertions correct? string is immutable string is reference type but behaves like value type For these code samples... string x = "one" (...
0votes
1answer
46views
String splits to create arrays
Creating an array of strings for configuration or verification purposes can get long and ugly in code. For example: arrayOfStrings = ['one','two','three','four'] Often to reduce the characters and ...
56votes
6answers
287kviews
Is initializing a char[] with a string literal bad practice?
I was reading a thread titled "strlen vs sizeof" on CodeGuru, and one of the replies states that "it's anyways [sic] bad practice to initialie [sic] a char array with a string literal." Is this true,...
4votes
3answers
17kviews
Best practice Java - String array constant and indexing it
For string constants its usual to use a class with final String values. But whats the best practice for storing string array. I want to store different categories in a constant array and everytime a ...